﻿// ----------------------------------------------------------------------------
// <copyright file="BoolToCursorConverter.cs" company="Insigma" >
//     Copyright (c) 浙江浙大网新众合轨道交通工程有限公司 版权所有。
// </copyright>
// <author> 龙珩 </author>
// <date> 2011-08-02</date>
// <summary> Bool变量到Cursor变量的转换 </summary>
// -----------------------------------------------------------------------
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Windows.Input;

namespace DCT.View
{
    [ValueConversion(typeof(bool), typeof(Cursor))]
    public class BoolToCursorConverter : IValueConverter
    {
        public object Convert(object value, Type typeTarget, object param, CultureInfo culture)
        {
            if (typeTarget == typeof(Cursor))
            {
                return (bool)value ? Cursors.None : Cursors.Arrow;
            }

            return null;
        }
        public object ConvertBack(object value, Type typeTarget, object param, CultureInfo culture)
        {
            return null;
        }
    }
}
